//
//  TermsViewController.m
//  MagazineShangejie
//
//  Created by wen on 16/1/28.
//  Copyright © 2016年 CnbizMedia. All rights reserved.
//

#import "TermsViewController.h"

@interface TermsViewController  ()<UIWebViewDelegate>
{

    __weak IBOutlet UIWebView *adWebView;
}
@end

@implementation TermsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSURL *url = [[NSURL alloc]initWithString:@"http://ksjv2.kanshangjie.com/template/privacy/index.html"];
    [adWebView loadRequest:[NSURLRequest requestWithURL:url]];
    
    
    
    UIButton *buttonf=[UIButton buttonWithType:UIButtonTypeCustom];
    [buttonf setFrame:CGRectMake(0, 0, 22, 22)];
    [buttonf addTarget:self action:@selector(popOfDismss) forControlEvents:UIControlEventTouchUpInside];
    [buttonf setImage:[UIImage imageNamed:@"dismiss"] forState:UIControlStateNormal];
    UIBarButtonItem*leftBarItem = [[UIBarButtonItem alloc]initWithCustomView:buttonf];
    self.navigationItem.leftBarButtonItem=leftBarItem;
    
}



-(void)popOfDismss{
    
    //    NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
    //    NSInteger number = [userDefault integerForKey:@"underBarShow"];
    //
    //    if (number == 1) {
    //设置通知，显示tabbar
    //    [[NSNotificationCenter defaultCenter] postNotificationName:@"showBootomBar" object:self userInfo:nil ];
    
    //    }
    
    //设置通知，广告显示完毕，跳转到主界面
//    [[NSNotificationCenter defaultCenter] postNotificationName:@"showTheNews" object:self userInfo:nil ];
    
    
    //    if ([[self.navigationController viewControllers] count]>=1) {
    //        //        self.hidesBottomBarWhenPushed = NO;
            [self.navigationController popViewControllerAnimated:YES];
    //
    //    }
    //    else{
    //        self.hidesBottomBarWhenPushed = NO;
//    [self dismissViewControllerAnimated:YES completion:nil];
    //    }
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
